// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "refactor/common-refactor.scss" as deprecated;

.text-context-menu {
  position: absolute;
  left: auto;
  bottom: var(--height);
  max-width: deprecated.$s-480;
  padding: deprecated.$s-4;
  margin: 0 0 deprecated.$s-4 0;
  z-index: deprecated.$z-index-4;
  border-radius: deprecated.$br-10;
  background-color: var(--context-menu-background-color);

  .palette-library,
  .file-library {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: deprecated.$s-8;
    padding: deprecated.$s-8;
    margin-bottom: deprecated.$s-4;
    border-radius: deprecated.$br-8;

    &:last-child {
      margin-bottom: 0;
    }
    .library-name {
      @include deprecated.bodySmallTypography;
      color: var(--context-menu-foreground-color);
      display: grid;
      grid-template-columns: 1fr deprecated.$s-24;
      max-width: deprecated.$s-400;
      .lib-name {
        @include deprecated.textEllipsis;
        max-width: deprecated.$s-380;
      }
      .lib-num {
        margin-left: deprecated.$s-4;
      }
    }
    .icon-wrapper {
      margin-left: deprecated.$s-4;
      @include deprecated.flexCenter;
      svg {
        @include deprecated.flexCenter;
        @extend .button-icon-small;
        stroke: var(--icon-foreground);
      }
    }
    &.selected,
    &:hover {
      .icon-wrapper {
        @include deprecated.flexCenter;
        svg {
          @include deprecated.flexCenter;
          @extend .button-icon-small;
          stroke: var(--context-menu-foreground-color-selected);
        }
      }
      .library-name {
        color: var(--context-menu-foreground-color-selected);
      }
    }

    &:hover {
      background-color: var(--context-menu-background-color-selected);
    }
  }
}
